import { defineStore } from "pinia";
import { SelfStorage } from '../securels'
import { UserInfoModel } from "@/models/authModel";
import UserInfo from "@/models/UserInfo";

export const useAuthStore = defineStore('authStore', {
    state: () => ({
        access_token: "",
        refresh_token:"",
        token_type:"",
        userInfo: {
            id:"",
            name: "",
            username: "",
            email: "",
            phone:"",
            gender: "",
            age: "",
            avatar: "", 
            status: "",
            source: "",
            referer: "",
            isVip:"",    
            city: "",
            sign:"",
            online:false,
            voiceUrl:""
        } as UserInfo
    }),
    persist: {
        key: 'AUTH',
        storage: SelfStorage,
    }
})